import request from '@/config/axios'

export interface ProductWarehouseVO {
  id: number
  productId: number
  inWarehouse: number
  outWarehouse: number
  standard: number
  safe: number
  fill: number
  status: number
  remark: string
}

// 查询产品仓储信息分页
export const getProductWarehousePage = async (params) => {
  return await request.get({ url: `/base/product-warehouse/page`, params })
}

// 查询产品仓储信息详情
export const getProductWarehouse = async (id: number) => {
  return await request.get({ url: `/base/product-warehouse/get?id=` + id })
}

// 查询产品仓储信息详情
export const getProductWarehouseByProduct = async (id: number) => {
  return await request.get({ url: `/base/product-warehouse/get/product?id=` + id })
}

// 新增产品仓储信息
export const createProductWarehouse = async (data: ProductWarehouseVO) => {
  return await request.post({ url: `/base/product-warehouse/create`, data })
}

// 修改产品仓储信息
export const updateProductWarehouse = async (data: ProductWarehouseVO) => {
  return await request.put({ url: `/base/product-warehouse/update`, data })
}

// 删除产品仓储信息
export const deleteProductWarehouse = async (id: number) => {
  return await request.delete({ url: `/base/product-warehouse/delete?id=` + id })
}

// 导出产品仓储信息 Excel
export const exportProductWarehouse = async (params) => {
  return await request.download({ url: `/base/product-warehouse/export-excel`, params })
}
